/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.examat.entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Fer
 */
@Entity
@Table(name = "profesor")
@NamedQueries({
    @NamedQuery(name = "Profesor.findAll", query = "SELECT p FROM Profesor p"),
    @NamedQuery(name = "Profesor.findByClaveUnica", query = "SELECT p FROM Profesor p WHERE p.claveUnica = :claveUnica"),
    @NamedQuery(name = "Profesor.findByAPaterno", query = "SELECT p FROM Profesor p WHERE p.aPaterno = :aPaterno"),
    @NamedQuery(name = "Profesor.findByAMaterno", query = "SELECT p FROM Profesor p WHERE p.aMaterno = :aMaterno"),
    @NamedQuery(name = "Profesor.findByNombre", query = "SELECT p FROM Profesor p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Profesor.findByPassword", query = "SELECT p FROM Profesor p WHERE p.password = :password")})
public class Profesor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ClaveUnica")
    private Integer claveUnica;
    @Size(max = 40)
    @Column(name = "APaterno")
    private String aPaterno;
    @Size(max = 40)
    @Column(name = "AMaterno")
    private String aMaterno;
    @Size(max = 30)
    @Column(name = "Nombre")
    private String nombre;
    @Size(max = 30)
    @Column(name = "Password")
    private String password;

    public Profesor() {
    }

    public Profesor(Integer claveUnica) {
        this.claveUnica = claveUnica;
    }

    public Integer getClaveUnica() {
        return claveUnica;
    }

    public void setClaveUnica(Integer claveUnica) {
        this.claveUnica = claveUnica;
    }

    public String getAPaterno() {
        return aPaterno;
    }

    public void setAPaterno(String aPaterno) {
        this.aPaterno = aPaterno;
    }

    public String getAMaterno() {
        return aMaterno;
    }

    public void setAMaterno(String aMaterno) {
        this.aMaterno = aMaterno;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (claveUnica != null ? claveUnica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Profesor)) {
            return false;
        }
        Profesor other = (Profesor) object;
        if ((this.claveUnica == null && other.claveUnica != null) || (this.claveUnica != null && !this.claveUnica.equals(other.claveUnica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.examat.entidades.Profesor[ claveUnica=" + claveUnica + " ]";
    }
    
}
